package com.google.code.xconf.schema.definition.value.options;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class ExtendedBooleanModes extends OptionsList {

    public static boolean isTrue(String expr, boolean caseSensitive) {
        List<String> flags = Arrays.asList("on", "true", "t", "1");
        return flags.contains(caseSensitive ? expr : expr.toLowerCase());
    }

    @Override
    protected Set<String> getOptions() {
        return new HashSet<>(Arrays.asList("on", "off", "true", "false", "t", "f", "1", "0"));
    }

}
